//
//  CustomNavVc.m
//  F FloatingPlayer
//
//  Created by yonas on 2018/9/26.
//  Copyright © 2018年 Inspur. All rights reserved.
//

#import "CustomNavVc.h"
#import "FloatingViewController.h"
#import "TransitionAnimation.h"
@interface CustomNavVc ()<FloatingPlayerControllerDelegate,UINavigationControllerDelegate>
@property(nonatomic,strong) FloatingViewController *floatingPlayerController;
@property(nonatomic,weak) FloatingViewModel *floatingModel;
@end

@implementation CustomNavVc
- (void)viewDidLoad {
    [super viewDidLoad];
//    
//    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(showFloatingView:) name:SHOW_FLOATING_VIEW object:nil];
//    
//    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(hideFloatingView) name:HIDE_FLOATING_VIEW object:nil];
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.childViewControllers.count>0){
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:animated];
}
//
//- (void)hideFloatingView{
//    [_floatingPlayerController floatingController_hide];
//    _floatingPlayerController = nil;
//    self.delegate = nil;
//}
//
//- (void)showFloatingView:(NSNotification *)notification{
//    FloatingViewModel *model =  notification.object;
//    FloatingViewController *floatingPlayerController = [[FloatingViewController alloc]initWithPlayerModel:model delegate:self];
//    [floatingPlayerController floatingController_show];
//    _floatingPlayerController = floatingPlayerController;
//    _floatingModel = model;
//    self.delegate = self;
//}
//- (CGRect)viewFrame{
//    return _floatingModel.viewFrame;
//}
//- (UIView *)floatingWindow{
//    return (UIView *)[_floatingPlayerController getFloatingWindow];
//}
//- (CGRect)originalFrame{
//    return _floatingModel.originalFrame;
//}
//#pragma mark - FloatingPlayerControllerDelegate
//- (void)floatingController_backToFromVcWithClass:(Class)cls floatingModel:(FloatingViewModel *)floatingModel floatingViewController:(FloatingViewController *)controller{
//    self.delegate = self;
//    UIViewController *viewController = [[cls alloc]init];
//    [self pushViewController:viewController animated:YES];
//}
//
//#pragma mark - UINavigationControllerDelegate
//- (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC{
//    if (operation == UINavigationControllerOperationPush){
//        return [TransitionAnimation transitionWithType:TransitionTypePush];
//    }else{
//        return [TransitionAnimation transitionWithType:TransitionTypePop];
//    }
//}
//
//- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
//    if ([viewController.class isEqual:NSClassFromString(_floatingModel.fromVc)]){
//        [self hideFloatingView];
//    }
//}
@end
